package org.example.login2;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import java.io.IOException;
import java.util.List;

import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;

@WebServlet("/studentList")
public class StudentListServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Student> studentList = InMemoryStudentDatabase.getStudentList();
        req.setAttribute("studentList", studentList);
        req.getRequestDispatcher("/studentList.jsp").forward(req, resp);
    }
}
